class PostArticleBean {
  String? nickName;
  String? avatar;
  String? recordId;
  String? userId;
  String? title;
  String? createTime;
  String? kilometers;
  String? ridingTime;
  String? ideas;
  List<String>? localFilePath;
  List<String>? cover;

  PostArticleBean({
    this.nickName,
    this.avatar,
    this.recordId,
    this.userId,
    this.title,
    this.createTime,
    this.kilometers,
    this.ridingTime,
    this.ideas,
    this.cover,
    this.localFilePath,
  });

  PostArticleBean.fromJson(Map<String, dynamic> json) {
    if (json["nickName"] is String) {
      nickName = json["nickName"];
    }
    if (json["avatar"] is String) {
      avatar = json["avatar"];
    }
    if (json["record_id"] is String) {
      recordId = json["record_id"];
    }
    if (json["user_id"] is String) {
      userId = json["user_id"];
    }
    if (json["title"] is String) {
      title = json["title"];
    }
    if (json["create_time"] is String) {
      createTime = json["create_time"];
    }
    if (json["kilometers"] is String) {
      kilometers = json["kilometers"];
    }
    if (json["riding_time"] is String) {
      ridingTime = json["riding_time"];
    }
    if (json["ideas"] is String) {
      ideas = json["ideas"];
    }
    if (json["local_file_path"] is List) {
      localFilePath = json["local_file_path"] == null ? null : List<String>.from(json["local_file_path"]);
    }
    if (json["cover"] is List) {
      cover = json["cover"] == null ? null : List<String>.from(json["cover"]);
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> _data = <String, dynamic>{};
    _data["nickName"] = nickName;
    _data["avatar"] = avatar;
    _data["record_id"] = recordId;
    _data["user_id"] = userId;
    _data["title"] = title;
    _data["create_time"] = createTime;
    _data["kilometers"] = kilometers;
    _data["riding_time"] = ridingTime;
    _data["ideas"] = ideas;
    if (cover != null) {
      _data["cover"] = cover;
    }
    if (localFilePath != null) {
      _data["local_file_path"] = localFilePath;
    }
    return _data;
  }

  PostArticleBean copyWith({
    String? nickName,
    String? avatar,
    String? recordId,
    String? userId,
    String? title,
    String? createTime,
    String? kilometers,
    String? ridingTime,
    String? ideas,
    List<String>? cover,
    List<String>? localFilePath,
  }) =>
      PostArticleBean(
        nickName: nickName ?? this.nickName,
        avatar: avatar ?? this.avatar,
        recordId: recordId ?? this.recordId,
        userId: userId ?? this.userId,
        title: title ?? this.title,
        createTime: createTime ?? this.createTime,
        kilometers: kilometers ?? this.kilometers,
        ridingTime: ridingTime ?? this.ridingTime,
        ideas: ideas ?? this.ideas,
        cover: cover ?? this.cover,
        localFilePath: localFilePath ?? this.localFilePath,
      );
}
